package org.karelun.whiteboard.edit.factory;

import org.karelun.whiteboard.Triangle;
import org.karelun.whiteboard.WhiteboardFactory;
import org.karelun.whiteboard.gef.requests.CreationFactory;

/**
 * @Author: KarelunHuang
 * @Date: Jan 23, 2013
 **/
public class WhiteboardCreationFactory implements CreationFactory{
	
	private Object objectType;
	
	public WhiteboardCreationFactory(Class<?> type){
		this.objectType=type;
	}
	
	@Override
	public Object getNewObject() {
		if(Triangle.class.equals(objectType)){
			return WhiteboardFactory.eINSTANCE.createTriangle();
		}
		return null;
	}

	@Override
	public Object getObjectType() {
		return objectType;
	}

}
